IF EXISTS(Select 1 From Sysobjects Where Name='dbArea1')
drop table dbArea1
GO 
  
GO  
--创建新表  
create table dbArea1(
	AreaID int identity(1,1) not null,
	AreaName varchar(200)
)

IF EXISTS(Select 1 From Sysobjects Where Name='dbHouseRegion')
drop table dbHouseRegion
GO 

GO
create table dbHouseRegion(
	HouseRegionID int identity(1,1) not null,
	HouseRegionName varchar(200),
	BaoMing int
)

IF EXISTS(Select 1 From Sysobjects Where Name='dbHouseGroup')
drop table dbHouseGroup
GO 

GO
create table dbHouseGroup(
	HouseGroupID int identity(1,1) not null,
	HouseRegionID int,
	HouseGroupName varchar(200)
)

IF EXISTS(Select 1 From Sysobjects Where Name='dbHouseNumber')
drop table dbHouseNumber
GO 
  
GO  
create table dbHouseNumber(
	HouseNumberID int identity(1,1) not null,
	HouseRegionID int,
	HouseGroupID int,
	ParentID int,
	HouseNumberType int default 0,
	HouseNumberName varchar(200),
	HouseArea varchar(200),
	OwnerName varchar(200),
	CertType varchar(200),
	CertNumber varchar(200),
	Phone varchar(200),
	Tel varchar(200),
	Email varchar(200)
)
GO 
ALTER TABLE BaoMing ADD
	HouseArea int NULL,
	NoteNo int NULL,
	HouseNumber1 int NULL,
	HouseNumber2 int NULL